<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    //1
    // toLowerCase  字母大转小
    function getlist(s) {
        var arr = s.split('-')
        return arr.map(function (item, index){
            if (index === 0) {
                return item                    
            }else{
                return item[0].toLowerCase() + item.slice(1)
            }
        }).join('-')
    }
    console.log(getlist('how-Arr-You'));  
    //1.1   
    // toUpperCase  字母小转大
    function getliss(s) {
        var arr = s.split('-')
        return arr.map(function (item, index){
            if (index === 0) {
                return item                    
            }else{
                return item[0].toUpperCase() + item.slice(1)
            }
        }).join('-')
    }
    console.log(getliss('how-are-you'));  


    //2
    var a='http://172.16.254.254:8081/?userip=172.15.42.19&usermac=58696ce014e7'
    function fn(a) {
            let x=a.split('?')[1].split('&')
            let ax={}
            for(var i=0;i<x.length;i++){
                ax[x[i].split('=')[0]]=x[i].split('=')[1]
            }
            return ax
    } 
    console.log(fn(a));

    
</script>